<#assign contextPath=springMacroRequestContext.getContextPath()/>
<#import "/public/frame/main.html" as frame/>
<@frame.head "南航明珠商城-二维码生成记录"></@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css"/>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i>后台管理中心 <span class="c-gray en">&gt;</span>商品管理 <span class="c-gray en">&gt;</span>二维码生成记录<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
  <div class="text-c">
    <form id="search_form" action="${contextPath}/qrcodeRecordController/queryQrcodeRecord" method="post">
      <input id="page" name="page" value="${pagination.pageNo}" type="hidden"/>  
      <table class="table search_table">
        <tr>  
          <td>渠道标识：</td>
          <td>
          	<input id="identifing" name="identifing" value="${qrcodeQo.identifing}" class="input-text radius"/>
          </td>  
          <td>商品编号：</td>
          <td>
          	<input id="productId" name="productId" value="${qrcodeQo.productId}" class="input-text radius" onkeyup="this.value=this.value.replace(/\D/g,'')" maxlength="17"/>
          </td> 
          <td>生成时间：</td>
          <td>
          	<input id="cBeginDate" name="cBeginDate" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'cEndDate\')}',readOnly: true})"
			class="input-text Wdate" style="width:45%;" value="${(qrcodeQo.cBeginDate?string('yyyy-MM-dd'))!}"/>
			至
			<input id="cEndDate" name="cEndDate" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'cBeginDate\')}',readOnly: true})"
			class="input-text Wdate" style="width:45%;" value="${(qrcodeQo.cEndDate?string('yyyy-MM-dd'))!}"/>
          </td> 
        </tr>
        <tr>  
          <td>生成平台：</td>
          <td>
          	<select id="qrSource" name="qrSource" class="select">
			  <option value="">所有</option>
			  <option value="P" <#if qrcodeQo.qrSource == 'P'>selected</#if>>pc端</option>
			  <option value="M" <#if qrcodeQo.qrSource == 'M'>selected</#if>>移动端</option>
			</select>
          </td>
          <td>二维码类型：</td>
          <td>
            <select id="qrType" name="qrType" class="select">
			  <option value="">所有</option>
			  <option value="A" <#if qrcodeQo.qrType == 'A'>selected</#if>>商城首页</option>
			  <option value="B" <#if qrcodeQo.qrType == 'B'>selected</#if>>单个商品</option>
			  <option value="C" <#if qrcodeQo.qrType == 'C'>selected</#if>>多个商品</option>
			</select>
          </td>
          <td>
             <input onclick="search();" class="btn btn-success radius" type="button" value="搜索"/>
          </td>
        </tr>
      </table>
    </form>
  </div>
  <div class="cl pd-5 bg-1 bk-gray mt-20"> 
    <span class="r">共有数据：<strong>${pagination.totalCount}</strong>条</span>
  </div>
  <table class="table table-border table-bordered table-bg">
    <thead>
      <tr class="text-c">
        <th>渠道标识</th>
        <th>生成时间</th>
        <th>生成平台</th>
        <th>二维码类型</th>
        <th>商品编号</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody >
       <#list pagination.list as list> 
       <tr class="text-c">
          <td>${list.identifing}</td>
          <td>${(list.createDate?string("yyyy-MM-dd HH:mm:ss"))!}</td>
          <td>
            <#if list.qrSource=='M'>移动端</#if>
            <#if list.qrSource=='P'>pc端</#if>
          </td>
          <td>
            <#if list.qrType=='A'>商城首页</#if>
            <#if list.qrType=='B'>单个商品</#if>
            <#if list.qrType=='C'>多个商品</#if>
          </td>
          <td>
		  <#if list.productId!=0>${list.productId}</#if>
		</td>
          <td>
            <a href="${contextPath}/qrcodeRecordController/explorQrcodeZip?id=${list.id}">重新下载</a>
          </td>
       </tr>
       </#list>
    </tbody>
  </table>
  <div id="div_page" style="padding-top: 10px;float: right"></div>
</div>
<@frame.end "default"></@frame.end>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript">
	var path = "${contextPath}";
	laypage({
		cont: "div_page",// 容器。值支持id名、原生dom对象，jquery对象。
	    pages: ${pagination.totalPage},// 通过后台拿到的总页数
	    curr: ${pagination.pageNo} || 1, // 当前页
		skip: true, // 是否开启跳页
		first: 1, // 将首页显示为数字1。若不显示，设置false即可
		last: ${pagination.totalPage}, // 将尾页显示为总页数。若不显示，设置false即可
	    jump: function(obj , first) { // 触发分页后的回调
	        if(!first){ // 点击跳页触发函数;当前页为obj.curr
	        	$("#page").val(obj.curr);
	            $("#search_form").submit();
	    	}
		}
	});
	function search(){
	    $("#page").val("1");
	    $("#search_form").submit();
	};
</script>